﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public enum itemtype
{
      UIitme,
      sunitem
}
public class UITime : MonoBehaviour {
    public itemtype itemypre;
    float h;
    float m;
    string time;
    Text text;
    TOD_Sky sky;
 	// Use this for initialization
	void Start () {
        switch (itemypre)
        {
            case itemtype.UIitme:
                text = GetComponent<Text>();
                break;
            case itemtype.sunitem:
                sky = GetComponent<TOD_Sky>();
                break;
            default:
                break;
        }
    }
	
	// Update is called once per frame
	void Update () {
        h = System.DateTime.Now.Hour;
        m = System.DateTime.Now.Minute;
        time = h + ":" + m;
        text.text = time;
    }
}
